import { setItem, getItem } from '@/utils/storage'
import { MAINCOLOR, DEFAULT_COLOR } from '@/constant'
export default {
  namespaced: true,
  state: {
    mainColor: getItem(MAINCOLOR) || DEFAULT_COLOR
  },

  mutations: {
    setMainColor(state, newColor) {
      state.mainColor = newColor
      setItem(MAINCOLOR, newColor)
    }
  }
}
